package com.jn.erp.wechat.mp.controller;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.jn.erp.common.core.result.AjaxResult;
import com.jn.erp.web.api.common.entity.InteractMessage;
import com.jn.erp.web.api.common.entity.dto.NoticeMessageDto;
import com.jn.erp.web.api.common.service.InteractMessageService;
import com.jn.erp.wechat.core.WxMessageData;
import com.jn.erp.wechat.mp.entity.MsgParam;
import com.jn.erp.wechat.mp.handler.MpMessageHandler;
import com.jn.erp.wechat.mp.service.NoticeMessageService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * <pre>
 *
 * </pre>
 *
 * @author sunjiyong
 * @since 2024/11/27 9:15
 */
@AllArgsConstructor
@RestController
@RequestMapping("/wxmp/notice")
public class WechatNoticeController {


    private NoticeMessageService noticeMessageService;

    /**
     *
     * 学生缴费告警
     * */
    @PostMapping("/arrearsMessage")
    public AjaxResult arrearsMessage(@RequestBody MsgParam msgParam){
        List<Long> sendIds=noticeMessageService.arrearsMessage(msgParam.getIds());
        if(sendIds==null){
            return AjaxResult.error("所传数据查询结果为空");
        }else{
            return AjaxResult.success(Arrays.toString(sendIds.toArray()));
        }
    }

}
